package com.bc.bccore.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bc.commoncore.util.HttpUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by ldm on 2018/4/17.
 */
public class GlobalNoUtils {
    /**
     * 获取全局编号
     *
     * @return
     */
    public static String getNo(String url, String platCode, String bussCode) {
        Map<String, String> param = new HashMap<>();
        param.put("platCode", platCode);
        param.put("bussCode", bussCode);
        String jsonStr = HttpUtil.sendJsonPost(url, JSON.toJSONString(param));
        JSONObject jsonObject = JSON.parseObject(jsonStr);

        return jsonObject.getString("data");
    }
    public static String getOnlyNo(String url) {

        String jsonStr = HttpUtil.sendJsonPost(url, null);
        JSONObject jsonObject = JSON.parseObject(jsonStr);

        return jsonObject.getString("data");
    }
    public static  void main(String args[]){
        System.out.println(getNo("http://192.168.102.185:8099/services/globalno/get","D","O"));
    }
}
